package com.sesame.controller;


import kim.sesame.framework.cas.CasUtil;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@CommonsLog
@Controller
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private Environment env;

    @RequestMapping("index")
    public String index(HttpServletRequest request, ModelMap modelMap) {

        modelMap.put("info", env.getProperty("server.port") + env.getProperty("server.context-path"));
        modelMap.put("sessionId", CasUtil.getSessionId(request));

        return "index";
    }

}
